import request from '@/utils/request'

// 顶部物品类型
export interface TopItem {
  itemId: number;
  itemName: string;
  quantity: number;
}

// 统计数据返回结构
export interface RecordStatsResponse {
  inboundTotal: number;
  inboundQuantity: number;
  inboundAmount: number;
  outboundTotal: number;
  outboundQuantity: number;
  outboundAmount: number;
  topInboundItems: TopItem[];
  topOutboundItems: TopItem[];
}

// 统计数据请求参数
export interface RecordStatsParams {
  timeRange?: 'day' | 'week' | 'month' | 'year' | 'custom';
  startDate?: string;
  endDate?: string;
}

// 获取出入库统计数据
export function getRecordStats(params: RecordStatsParams) {
  return request.get<RecordStatsResponse>('/records/stats', { params });
} 